//
//  LTClient.h
//  LTIM
//
//  Created by 俊松何 on 2017/3/27.
//  Copyright © 2017年 俊松何. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "LTClientDelegate.h"

@class LTChatManager,LTContactManager,LTChatroomManager,LTGroupManager,
LTCallManager,LTError,LTHTTPTool,LTClientDelegate,LTChatMomentRedDotManger,LTUser;
@interface LTClient : NSObject

/**
 版本号
 */
@property (nonatomic, strong, readonly) NSString *version;

@property (nonatomic, copy, readonly) NSString *appId;

/**
 当前登录账号的userid
 */
@property (nonatomic, strong, readonly) NSString *currentUserId;

/**
 当前登录账号的user
 */
@property (nonatomic, strong, readonly) LTUser   *currentUser;

/**
 聊天模块
 */
@property (nonatomic, strong, readonly) LTChatManager *chatManager;

/**
 好友模块
 */
@property (nonatomic, strong, readonly) LTContactManager *contactManager;


/**
 群组模块
 */
@property (nonatomic, strong, readonly) LTGroupManager *groupManager;


/**
 聊天室模块
 */
@property (nonatomic, strong, readonly) LTChatroomManager *chatRoomManager;

/**
 实时音视屏模块
 */
@property (nonatomic, strong, readonly) LTCallManager *callManager;

/**
 小红点管理
 */
@property (nonatomic, strong, readonly) LTChatMomentRedDotManger *redDotManager;

@property (nonatomic, assign) BOOL isDetail;

@property(nonatomic,assign) int clientVersion;

+(instancetype)sharedClient;



/**
 初始化操作

 @param appid  appID(区分联图 和泰国联图)
 */
-(void)initWithAppId:(NSString *)appid;


/**
 添加LTClientDelegate

 @param delegate LTClientDelegate 实例
 */
- (void)addDelegate:(id<LTClientDelegate>)delegate;







-(void)loginWithUser:(LTUser *)user;

-(void)Autologin;

-(void)loginWithPhonenumber:(NSString *)phoneNumber
               country_code:(NSString *)country_code
                  passworld:(NSString *)passworld
                 completion:(void(^)(NSString *ausername,LTError *lterror))completionblock;





//三方登录
-(void)loginWithThirPartDict:(NSDictionary *)ThirPartDict
                  completion:(void(^)(LTError *lterror))completionblock;


-(void)registerWithUsername:(NSString *)userName               //用户昵称
                      phone:(NSString *)phone                  //电话号码
                        pwd:(NSString *)pwd                    // 密码
               country_code:(NSString *)country_code           // 手机号国际编码
                 verifyCode:(NSString *)verifyCode                   //验证吗
               coinPassword:(NSString *)coinPassword
             fromInviteCode:(NSString *)fromInviteCode
                 completion:(void(^)(NSString *username,LTError *error))completion;


-(void)registerUser:(LTUser *)user
          passworld:(NSString *)passworld
         completion:(void(^)(LTError *lterror))completionblock;

-(void)loginWithUser:(LTUser *)user
           passworld:(NSString *)passworld
          completion:(void(^)(LTError *lterror))completionblock;


-(void)enterBackgroundClick;

-(void)becomeActiveClick;

-(void)loginOut;

@end
